exports = {
  data : {
    id: 0,
    info: {},
    jsfTpl : {},
  },
  use : ['rb','jquery','form','datetimepicker','upload','element','wxuploadimg'],
  init : function(rb,$) {
    var id = this.data.id;
    if(id){
      var that = this;
      var url = layui.cache.apiPath + rb.controller + '/detail';
      rb.getJSONSync(url,{id : id},function(data) {
        // rb.d.rolse     = rb.getSortList(data.roles);
        rb.d.roles = data.roles;//select判断完了
        that.data.info  = data.info;
      })
    }
    var info = this.data.info;
    this.data.jsfTpl = rb.jsfTpls(info,[
      ['*name'+(id ? '|text*' : '')],
      [(id ? '' : '*')+'pass*'],
      ['nick','input-long'],
      ['avatar|btimg','',1],
      ['phone'],
      ['email'],
      ['status|radio'],
      ['*role*|selects|'+(info['role_id'] ?? 0),'',rb.d.roles]
    ],{
      name: "用户名",
      pass: "密码"
    });
  },
  after : function(rb,$,form) {
    // TODO 渲染完后
    console.log("this.data",this.data);
    form.render(null,"jsf-user-form");
    <!--# include virtual="/lib/pic-select.js" -->
  }
}